// 列表页面相关的功能
//换背景色
var oldclassName = null;
var curObj = null;
function changeBgColor(tempi){
    if(curObj != null){
	//alert(curObj.getElementsByTagName("input")[0].tagName);
	  if(curObj.getElementsByTagName("input")[0].checked){
	    curObj.style.backgroundColor="";
	  }
	  else{
	    curObj.style.backgroundColor="";
	  }
	  curObj.className=oldclassName;//
	}
	oldclassName=tempi.className;

    tempi.className="mouseover";
	curObj=tempi;
}



var tag = "0";
  function selectAll(){
   var checkBoxs = document.getElementsByName("docId");

   if(tag == "0"){
   for(i = 0; i < checkBoxs.length; i++)
  {
    checkBoxs[i].checked=true;
  }
   tag = "1";
   return true;
}

   if(tag == "1"){
   for(i = 0; i < checkBoxs.length; i++)
  {
    checkBoxs[i].checked=false;
  }
   tag = "0";
   return true;
}
}

function showOrHide(searchButton){
	var heightOfSearchBar;
	if(searchButton.value=="隐藏检索栏"){
		heightOfSearchBar=$("search").offsetHeight;
		$("search").hide();
		searchButton.value="显示检索栏";
		$("divContent").style.height=getHeightAsInt($("divContent").style.height)+heightOfSearchBar+"px";
	}else{
		$("search").show();
		heightOfSearchBar=$("search").offsetHeight;
		searchButton.value="隐藏检索栏";
		$("divContent").style.height=getHeightAsInt($("divContent").style.height)-heightOfSearchBar+"px";
	}
}
function getHeightAsInt(height){
	//以px为单位
	height=height.substring(0,height.length-2);
	return new Number(height);
}

function resizeDivContent(){
	//alert($("operationBar").getHeight()+"****"+$("content").getHeight());
	//alert("****content");
	//alert(document.body.clientHeight);getHeightAsInt($("divContent").style.height)
	$("divContent").style.height=$("divContent").getHeight()+(document.body.clientHeight-$("operationBar").getHeight()-$("content").getHeight())-4+"px";
}

function resizeSidebar(sidebar){
	//alert($("operationBar").getHeight()+"****"+$("content").getHeight());
	//alert("****sibabar");
	//alert(document.body.clientHeight);getHeightAsInt($("divContent").style.height)
	if(sidebar==''||sidebar==undefined){
		$("sidebar").style.height=$("divContent").getHeight()+"px";
	}else{
		$(sidebar).style.height=$("divContent").getHeight()+"px";
	}
}